package com.tjbklx1.pattern.builder.demo3;

import java.util.ArrayList;

public class Director {
	private ArrayList<String> sequence = new ArrayList<String>();
	private CarBuilder benzBuilder = new BenzBuilder();
	private CarBuilder bmwBuilder = new BMWBuilder();

	/**
	 * Benz A型车
	 * 
	 * @return
	 */
	public BenzModel getABenzMode() {
		this.sequence.clear();
		this.sequence.add("start");
		this.sequence.add("stop");
		this.benzBuilder.setSequence(sequence);
		return (BenzModel) this.benzBuilder.getCarModel();
	}

	/**
	 * Benz B型车
	 * 
	 * @return
	 */
	public BenzModel getBBenzMode() {
		this.sequence.clear();
		this.sequence.add("engineBoom");
		this.sequence.add("start");
		this.sequence.add("engineBoom");
		this.sequence.add("alarm");
		this.sequence.add("stop");
		this.benzBuilder.setSequence(sequence);
		return (BenzModel) this.benzBuilder.getCarModel();
	}

	/**
	 * BMW A型车
	 * 
	 * @return
	 */
	public BMWModel getABMWMode() {
		this.sequence.clear();
		this.sequence.add("start");
		this.sequence.add("stop");
		this.bmwBuilder.setSequence(sequence);
		return (BMWModel) this.bmwBuilder.getCarModel();
	}

	/**
	 * BMW B型车
	 * 
	 * @return
	 */
	public BMWModel getBBMWMode() {
		this.sequence.clear();
		this.sequence.add("engineBoom");
		this.sequence.add("start");
		this.sequence.add("engineBoom");
		this.sequence.add("alarm");
		this.sequence.add("stop");
		this.sequence.add("engineBoom");
		this.bmwBuilder.setSequence(sequence);
		return (BMWModel) this.bmwBuilder.getCarModel();
	}

}
